﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace MicroDal.Providers
{
    /// <summary>
    /// DbParameter configuration
    /// </summary>
    public class ParameterConfig
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ParameterConfig"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="direction">The direction.</param>
        public ParameterConfig(string name, ParameterDirection direction = ParameterDirection.Input)
        {
            this.Name = name;
            this.Direction = direction;
        }

        /// <summary>
        /// Performs an implicit conversion from <see cref="System.String"/> to <see cref="MicroDal.Providers.ParameterConfig"/>.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>The result of the conversion.</returns>
        public static implicit operator ParameterConfig(string name){
            return new ParameterConfig(name);
        }
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name { get; set; }
        /// <summary>
        /// Gets or sets the direction.
        /// </summary>
        /// <value>The direction.</value>
        public ParameterDirection Direction { get; set; }
    }
}
